<?php

namespace frontend\assets;

use yii\web\AssetBundle;
use yii\web\View;

/**
 * Main frontend application asset bundle.
 */
class AppAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
           'statics/css/public/font-awesome.min.css',
             'statics/css/public/bootstrap.min.css',
           'statics/css/base.css',
            'statics/css/com.css',
    ];
    public $js = [
        'statics/js/public/jquery-1.12.0.min.js',
          'statics/js/public/require.js',
    ];
    public $jsOptions = ["position"=> View::POS_HEAD];
    //定义按需加载JS方法，注意加载顺序在最后
    public static function addScript($view, $jsfile) {
        $view->registerJsFile($jsfile, [AppAsset::className(), 'depends' => 'frontend\assets\AppAsset']);
    }

    //定义按需加载css方法，注意加载顺序在最后
    public static function addCss($view, $cssfile) {
        $view->registerCssFile($cssfile, [AppAsset::className(), 'depends' => 'frontend\assets\AppAsset']);

    }
    public function init()
    {

    }
}
